// lib/pages/empowerment_platform.dart
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:portal_website/pages/common_header.dart';

import 'package:flutter/material.dart';
import 'package:portal_website/pages/two/interlligent_compu_center_page.dart';
import 'package:portal_website/pages/two/knowlege_center_page.dart';
import 'package:portal_website/pages/two/model_center_page.dart';
import 'package:portal_website/pages/two/scene_applica_center_page.dart';
import 'package:portal_website/tool/image_network.dart';

class EmpowermentPlatformPage extends StatelessWidget {
  const EmpowermentPlatformPage({super.key});

  @override
  Widget build(BuildContext context) {
    final navItems = [
      {'name': '首页', 'route': '/'},
      {'name': '赋能平台', 'route': '/'},
      {'name': '解决方案', 'route': '/'},
      {'name': '成功案例', 'route': '/'},
      {'name': '联系我们', 'route': '/'},
    ];
    return Scaffold(
      backgroundColor: const Color(0xFFF5F9FF),
      body: SingleChildScrollView(
        child: Padding(
          padding: const EdgeInsets.all(20.0),
          child: Column(
            children: [
              // CommonHeader(
              //     title: "创新服务平台", navItems: navItems, currentRoute: "/"),
              // 头部导航
              // Container(
              //   decoration: BoxDecoration(
              //     gradient: LinearGradient(
              //       colors: [Color(0xFF1E5799), Color(0xFF207CCA)],
              //       begin: Alignment.topLeft,
              //       end: Alignment.bottomRight,
              //     ),
              //     borderRadius: BorderRadius.circular(8),
              //     boxShadow: [
              //       BoxShadow(
              //         color: Colors.black12,
              //         blurRadius: 10,
              //         offset: Offset(0, 5),
              //       ),
              //     ],
              //   ),
              //   padding:
              //       const EdgeInsets.symmetric(vertical: 30, horizontal: 30),
              //   child: Column(
              //     children: [
              //       Row(
              //         mainAxisAlignment: MainAxisAlignment.spaceBetween,
              //         children: [
              //           const Text(
              //             '创新服务平台',
              //             style: TextStyle(
              //               color: Colors.white,
              //               fontSize: 24,
              //               fontWeight: FontWeight.bold,
              //             ),
              //           ),
              //           // 导航菜单
              //           Wrap(
              //             spacing: 25,
              //             children: [
              //               _navItem('首页', context),
              //               _navItem('赋能平台', context, isActive: true),
              //               _navItem('解决方案', context),
              //               _navItem('成功案例', context),
              //               _navItem('联系我们', context),
              //             ],
              //           ),
              //         ],
              //       ),
              //     ],
              //   ),
              // ),

              // 面包屑导航
              Container(
                padding: const EdgeInsets.all(20),
                alignment: Alignment.centerLeft,
                child: const Text(
                  '首页 > 赋能平台',
                  style: TextStyle(
                    color: Color(0xFF666666),
                    fontSize: 14,
                  ),
                ),
              ),
              PageTitle(
                title: "赋能平台",
                subtitle: "创新服务平台构建四大核心赋能平台，为企业数字化转型提供全方位支持",
              ),

              // 平台介绍
              _buildIntroSection(),

              // 核心赋能平台
              _buildPlatformSection(),

              // 平台详情
              _buildDetailSection(),

              // 成功案例
              _buildCaseSection(),

              // 页脚
              CommonFooter(
                links: [
                  {'name': '关于我们'},
                  {'name': '服务条款'},
                  {'name': '隐私政策'},
                  {'name': '帮助中心'},
                  {'name': '联系我们'},
                ],
                copyright: '© 2025 创新服务平台 版权所有',
                contactInfo:
                    '地址：XX省XX市XX区XX路XX号 | 服务热线：400-123-4567 | 邮箱：contact@innovationservice.com',
              ),
            ],
          ),
        ),
      ),
    );
  }

  // 平台介绍部分
  Widget _buildIntroSection() {
    return Container(
      margin: const EdgeInsets.all(20),
      padding: const EdgeInsets.all(40),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 15,
            offset: const Offset(0, 3),
          ),
        ],
      ),
      child: Column(
        children: [
          Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: const [
                    Padding(
                      padding: EdgeInsets.only(bottom: 20),
                      child: Text(
                        '赋能平台概述',
                        style: TextStyle(
                          fontSize: 24,
                          color: Color(0xFF1E5799),
                        ),
                      ),
                    ),
                    Padding(
                      padding: EdgeInsets.only(bottom: 20),
                      child: Text(
                        '创新服务平台整合前沿技术和优质资源，构建了智算中心、知识中枢、模型中枢和场景应用中心四大赋能平台，形成完整的数字化转型服务体系。',
                        style: TextStyle(
                          fontSize: 16,
                          color: Color(0xFF555555),
                          height: 1.8,
                        ),
                      ),
                    ),
                    Padding(
                      padding: EdgeInsets.only(bottom: 20),
                      child: Text(
                        '四大平台相互协同，覆盖从底层计算能力、知识资源、算法模型到应用场景的全链条服务，为企业提供一站式数字化转型解决方案。',
                        style: TextStyle(
                          fontSize: 16,
                          color: Color(0xFF555555),
                          height: 1.8,
                        ),
                      ),
                    ),
                    Text(
                      '赋能平台已服务超过1000家企业，支持500多个数字化转型项目，成为区域创新发展的重要支撑。',
                      style: TextStyle(
                        fontSize: 16,
                        color: Color(0xFF555555),
                        height: 1.8,
                      ),
                    ),
                  ],
                ),
              ),
              const SizedBox(width: 40),
              ImageNetwork(
                '',
                width: 500,
                height: 300,
                fit: BoxFit.cover,
              ),
            ],
          ),
        ],
      ),
    );
  }

  // 核心赋能平台部分
  Widget _buildPlatformSection() {
    return Container(
      margin: const EdgeInsets.all(20),
      padding: const EdgeInsets.all(40),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 15,
            offset: const Offset(0, 3),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          _sectionTitle('核心赋能平台'),
          const Padding(
            padding: EdgeInsets.only(bottom: 30),
            child: Text(
              '四大赋能平台各具特色，共同构成创新服务平台的核心竞争力',
              style: TextStyle(
                fontSize: 16,
                color: Color(0xFF666666),
              ),
            ),
          ),
          GridView.count(
            shrinkWrap: true,
            physics: const NeverScrollableScrollPhysics(),
            crossAxisCount: 1,
            crossAxisSpacing: 30,
            mainAxisSpacing: 30,
            childAspectRatio: 550 / 300,
            children: [
              _platformCard(
                icon: '💻',
                title: '智算中心',
                description:
                    '智算中心是创新服务平台的计算基础设施，提供强大的计算能力和算法支持。中心拥有超过10PFlops的计算能力，配备最新的GPU和TPU加速卡，支持大规模并行计算和深度学习训练任务。',
                features: [
                  '高性能计算服务',
                  'AI训练平台',
                  '大数据分析',
                  '安全计算环境',
                  '边缘协同计算',
                ],
                imageUrl: '',
                tag: 0,
              ),
              _platformCard(
                icon: '📚',
                title: '知识中枢',
                description:
                    '知识中枢是创新服务平台的知识基础设施，集成了行业知识库、专家资源库和智能问答系统。中枢汇聚了超过100万篇行业文献、50万项专利数据和5千位行业专家资源，通过人工智能技术实现知识的智能检索和关联分析。',
                features: [
                  '行业知识库',
                  '专家资源库',
                  '智能检索系统',
                  '知识图谱构建',
                  '智能问答服务',
                ],
                imageUrl: '',
                tag: 1,
              ),
              _platformCard(
                icon: '🧠',
                title: '模型中枢',
                description:
                    '模型中枢是创新服务平台的AI模型资源库，集成了机器学习、深度学习和传统算法模型。中枢汇聚了超过1000个预训练模型，覆盖计算机视觉、自然语言处理、语音识别、推荐系统等多个领域，为企业和开发者提供模型开发、训练、部署和应用的全流程支持。',
                features: [
                  '模型仓库',
                  '训练平台',
                  '推理服务',
                  '模型管理',
                  '联邦学习',
                ],
                imageUrl: '',
                tag: 2,
              ),
              _platformCard(
                icon: '🖥️',
                title: '场景应用中心',
                description:
                    '场景应用中心是创新服务平台的应用展示平台，聚焦各行业数字化转型需求，提供从技术到场景的完整解决方案。中心汇聚了来自智能制造、智慧城市、数字医疗、智慧农业等领域的200多个成功案例，通过展示优秀案例、提供解决方案咨询、组织场景对接活动等方式，帮助企业找到最适合的技术应用路径。',
                features: [
                  '场景展示',
                  '需求对接',
                  '方案验证',
                  '技术咨询',
                  '成果推广',
                ],
                imageUrl: '',
                tag: 3,
              ),
            ],
          ),
        ],
      ),
    );
  }

  // 平台卡片
  Widget _platformCard({
    required String icon,
    required String title,
    required String description,
    required List<String> features,
    required String imageUrl,
    required int tag,
  }) {
    return Container(
      padding: const EdgeInsets.all(30),
      decoration: BoxDecoration(
        color: const Color(0xFFF9FBFF),
        borderRadius: BorderRadius.circular(8),
        border: Border.all(color: const Color(0xFFE0E9FF)),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 10,
            offset: const Offset(0, 5),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            children: [
              Text(
                icon,
                style: const TextStyle(fontSize: 40),
              ),
              const SizedBox(width: 20),
              Text(
                title,
                style: const TextStyle(
                  fontSize: 22,
                  color: Color(0xFF1E5799),
                  fontWeight: FontWeight.bold,
                ),
              ),
            ],
          ),
          const SizedBox(height: 20),
          Expanded(
            child: Row(
              children: [
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        description,
                        style: const TextStyle(
                          color: Color(0xFF555555),
                          fontSize: 15,
                          height: 1.8,
                        ),
                        overflow: TextOverflow.visible,
                      ),
                      const SizedBox(height: 20),
                      Padding(
                        padding: EdgeInsets.only(bottom: 15),
                        child: const Text(
                          '核心能力',
                          style: TextStyle(
                            fontSize: 16,
                            color: Color(0xFF1E5799),
                            fontWeight: FontWeight.bold,
                          ),
                        ),
                      ),
                      Expanded(
                        child: ListView.builder(
                          shrinkWrap: true,
                          physics: const NeverScrollableScrollPhysics(),
                          itemCount: features.length,
                          itemBuilder: (context, index) {
                            return Padding(
                              padding: const EdgeInsets.only(bottom: 10),
                              child: Row(
                                children: [
                                  const Text(
                                    '✓',
                                    style: TextStyle(
                                      color: Color(0xFF207CCA),
                                    ),
                                  ),
                                  SizedBox(
                                    width: 10,
                                  ),
                                  Text(
                                    features[index],
                                    style: const TextStyle(
                                      color: Color(0xFF555555),
                                      fontSize: 15,
                                    ),
                                  ),
                                ],
                              ),
                            );
                          },
                        ),
                      ),
                      const SizedBox(height: 20),
                      ElevatedButton(
                        onPressed: () {
                          if (tag == 0) {
                            Get.to(InterlligentCompuCenterPage());
                          } else if (tag == 1) {
                            Get.to(KnowledgeCenterPage());
                          } else if (tag == 2) {
                            Get.to(ModelCenterPage());
                          } else if (tag == 3) {
                            Get.to(SceneApplicaCenterPage());
                          }
                        },
                        style: ElevatedButton.styleFrom(
                          backgroundColor: const Color(0xFF1E5799),
                          padding: const EdgeInsets.symmetric(
                            horizontal: 20,
                            vertical: 8,
                          ),
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(4),
                          ),
                        ),
                        child: const Text(
                          '了解详情',
                          style: TextStyle(
                            color: Colors.white,
                            fontSize: 14,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
                const SizedBox(width: 30),
                ImageNetwork(
                  imageUrl,
                  width: 250,
                  height: 180,
                  fit: BoxFit.cover,
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

  // 平台详情部分
  Widget _buildDetailSection() {
    return Container(
      margin: const EdgeInsets.all(20),
      padding: const EdgeInsets.all(40),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 15,
            offset: const Offset(0, 3),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          _sectionTitle('平台详情'),

          // 智算中心详情
          _detailItem(
            title: '智算中心',
            description:
                '智算中心采用分层架构设计，从基础设施到应用服务形成完整的计算服务体系。中心拥有200+计算节点，包含CPU、GPU和TPU多种架构，峰值计算能力达10PFlops。存储系统采用全闪存架构，总容量20PB，支持高并发IO访问。网络系统采用100Gbps高速互联，实现低延迟、高带宽的数据传输。',
            additionalDesc:
                '智算中心已服务超过200家企业、50所高校和研究机构，累计完成计算任务超过10万项，有力支撑了区域科技创新和产业升级。',
            imageUrl: '',
            featureTitle: '技术架构',
            features: [
              {'title': '基础设施层', 'desc': '高性能计算集群、存储系统、网络设备等硬件基础设施'},
              {'title': '资源管理层', 'desc': 'Kubernetes、Slurm等资源调度和管理系统'},
              {'title': '计算引擎层', 'desc': 'Spark、Flink、TensorFlow等计算框架和引擎'},
              {'title': '工具服务层', 'desc': '开发工具、模型库、数据集等支持服务'},
              {'title': '应用接口层', 'desc': 'REST API、SDK、Web门户等应用接口'},
              {'title': '行业应用层', 'desc': '面向各行业的解决方案和应用案例'},
            ],
          ),

          // 知识中枢详情
          _detailItem(
            title: '知识中枢',
            description:
                '知识中枢采用多模态知识图谱技术，将结构化数据和非结构化文本深度融合，构建了覆盖多个领域的知识网络。中枢建设分为三个阶段：一期工程完成了基础平台搭建和核心知识库建设；二期工程实现了多模态知识融合和智能服务升级；三期工程将重点打造行业垂直知识库和专家协同网络。',
            additionalDesc:
                '目前，知识中枢已整合了来自100多个数据源的知识资源，构建了20多个领域的知识图谱，服务用户超过10万人，日均知识检索量超过5万次。',
            imageUrl: '',
            featureTitle: '核心资源',
            features: [
              {'title': '行业知识库', 'desc': '涵盖科技、经济、产业等多个领域的专业文献、研究报告和技术标准'},
              {'title': '专家资源库', 'desc': '汇集各领域专家学者，提供咨询、评审和技术支持服务'},
              {'title': '智能检索系统', 'desc': '基于自然语言处理的智能搜索，精准匹配用户知识需求'},
              {'title': '数据分析平台', 'desc': '提供数据可视化、趋势分析和知识发现工具'},
            ],
          ),
        ],
      ),
    );
  }

  // 详情项
  Widget _detailItem({
    required String title,
    required String description,
    required String additionalDesc,
    required String imageUrl,
    required String featureTitle,
    required List<Map<String, String>> features,
  }) {
    return Container(
      // marginBottom: 50,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 20),
            child: Text(
              title,
              style: const TextStyle(
                fontSize: 22,
                color: Color(0xFF1E5799),
                fontWeight: FontWeight.bold,
              ),
            ),
          ),
          Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Expanded(
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      description,
                      style: const TextStyle(
                        fontSize: 16,
                        color: Color(0xFF555555),
                        height: 1.8,
                        // margin: EdgeInsets.only(bottom: 20),
                      ),
                    ),
                    Text(
                      additionalDesc,
                      style: const TextStyle(
                        fontSize: 16,
                        color: Color(0xFF555555),
                        height: 1.8,
                      ),
                    ),
                  ],
                ),
              ),
              const SizedBox(width: 30),
              ImageNetwork(
                imageUrl,
                width: 400,
                height: 250,
                fit: BoxFit.cover,
              ),
            ],
          ),
          const SizedBox(height: 30),
          Text(
            featureTitle,
            style: const TextStyle(
              fontSize: 18,
              color: Color(0xFF1E5799),
              fontWeight: FontWeight.bold,
            ),
          ),
          SizedBox(
            height: 20,
          ),
          GridView.count(
            shrinkWrap: true,
            physics: const NeverScrollableScrollPhysics(),
            crossAxisCount: 3,
            crossAxisSpacing: 20,
            mainAxisSpacing: 20,
            childAspectRatio: 250 / 100,
            children: features.map((feature) {
              return Container(
                padding: const EdgeInsets.all(20),
                decoration: BoxDecoration(
                  color: const Color(0xFFF0F7FF),
                  borderRadius: BorderRadius.circular(8),
                  border: Border(
                    left: BorderSide(
                      color: const Color(0xFF207CCA),
                      width: 4,
                    ),
                  ),
                ),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      feature['title']!,
                      style: const TextStyle(
                        fontSize: 16,
                        color: Color(0xFF1E5799),
                        fontWeight: FontWeight.bold,
                      ),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      feature['desc']!,
                      style: const TextStyle(
                        color: Color(0xFF666666),
                        fontSize: 14,
                      ),
                    ),
                  ],
                ),
              );
            }).toList(),
          ),
          const SizedBox(height: 50),
        ],
      ),
    );
  }

  // 成功案例部分
  Widget _buildCaseSection() {
    return Container(
      margin: const EdgeInsets.all(20),
      padding: const EdgeInsets.all(40),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 15,
            offset: const Offset(0, 3),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          _sectionTitle('成功案例'),
          const Padding(
            padding: EdgeInsets.only(bottom: 30),
            child: Text(
              '赋能平台已成功支持多个行业的数字化转型项目',
              style: TextStyle(
                fontSize: 16,
                color: Color(0xFF666666),
              ),
            ),
          ),
          GridView.count(
            shrinkWrap: true,
            physics: const NeverScrollableScrollPhysics(),
            crossAxisCount: 3,
            crossAxisSpacing: 30,
            mainAxisSpacing: 30,
            childAspectRatio: 300 / 350,
            children: [
              _caseCard(
                title: 'AI辅助新药研发',
                description:
                    '利用智算中心和模型中枢的计算能力和AI模型，为某制药企业提供分子动力学模拟和药物分子设计计算服务，将新药研发周期缩短40%。',
                imageUrl: '',
              ),
              _caseCard(
                title: '智能制造质量预测',
                description:
                    '通过场景应用中心和模型中枢的服务，帮助制造企业建立产品质量预测模型，实现生产过程的实时监控和缺陷预警。',
                imageUrl: '',
              ),
              _caseCard(
                title: '金融风控模型训练',
                description: '为金融机构提供大规模风控模型训练服务，处理PB级交易数据，提升欺诈识别准确率。',
                imageUrl: '',
              ),
            ],
          ),
        ],
      ),
    );
  }

  // 案例卡片
  Widget _caseCard({
    required String title,
    required String description,
    required String imageUrl,
  }) {
    return Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 15,
            offset: const Offset(0, 5),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          ImageNetwork(
            imageUrl,
            width: double.infinity,
            height: 180,
            fit: BoxFit.cover,
          ),
          Expanded(
            child: Container(
              padding: const EdgeInsets.all(20),
              color: Colors.white,
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    title,
                    style: const TextStyle(
                      fontSize: 18,
                      color: Color(0xFF1E5799),
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                  SizedBox(
                    height: 10,
                  ),
                  Text(
                    description,
                    style: const TextStyle(
                      color: Color(0xFF666666),
                      fontSize: 14,
                    ),
                  ),
                  SizedBox(
                    height: 15,
                  ),
                  TextButton(
                    onPressed: () {},
                    style: TextButton.styleFrom(
                      padding: EdgeInsets.zero,
                      minimumSize: const Size(50, 30),
                      alignment: Alignment.centerLeft,
                    ),
                    child: const Text(
                      '查看详情 →',
                      style: TextStyle(
                        color: Color(0xFF207CCA),
                        fontWeight: FontWeight.bold,
                        fontSize: 14,
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }

  // 页脚链接
  Widget _footerLink(String text) {
    return TextButton(
      onPressed: () {},
      style: TextButton.styleFrom(
        padding: EdgeInsets.zero,
        minimumSize: const Size(50, 30),
      ),
      child: Text(
        text,
        style: const TextStyle(
          color: Color(0xFFA8B2D1),
          fontSize: 16,
        ),
      ),
    );
  }

  //  section标题
  Widget _sectionTitle(String title) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Text(
          title,
          style: const TextStyle(
            fontSize: 24,
            color: Color(0xFF1E5799),
            fontWeight: FontWeight.bold,
          ),
        ),
        Container(
          margin: EdgeInsets.only(top: 15),
          width: 80,
          height: 2,
          color: const Color(0xFF207CCA),
        ),
      ],
    );
  }
}

class PlatformCard extends StatelessWidget {
  final Map<String, dynamic> platform;

  const PlatformCard({super.key, required this.platform});

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: const Color(0xFFf9fbff),
        borderRadius: BorderRadius.circular(8),
        border: Border.all(color: const Color(0xFFe0e9ff)),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 10,
            spreadRadius: 2,
            offset: const Offset(0, 5),
          ),
        ],
      ),
      padding: const EdgeInsets.all(30),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // 平台标题和图标
          Row(
            children: [
              Text(
                platform['icon'],
                style: const TextStyle(fontSize: 40),
              ),
              const SizedBox(width: 20),
              Text(
                platform['title'],
                style: const TextStyle(
                  fontSize: 22,
                  color: Color(0xFF1e5799),
                  fontWeight: FontWeight.bold,
                ),
              ),
            ],
          ),
          const SizedBox(height: 20),

          // 平台内容
          Expanded(
            child: Row(
              children: [
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        platform['description'],
                        style: const TextStyle(
                          color: Color(0xFF555555),
                          fontSize: 15,
                          height: 1.8,
                        ),
                        overflow: TextOverflow.visible,
                      ),
                      const SizedBox(height: 20),
                      const Text(
                        '核心能力',
                        style: TextStyle(
                          fontSize: 16,
                          color: Color(0xFF1e5799),
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                      const SizedBox(height: 15),
                      Column(
                        children: (platform['features'] as List<String>)
                            .map((feature) => Padding(
                                  padding: const EdgeInsets.only(bottom: 10),
                                  child: Row(
                                    children: [
                                      const Text(
                                        '✓',
                                        style: TextStyle(
                                          color: Color(0xFF207cca),
                                          fontSize: 16,
                                        ),
                                      ),
                                      const SizedBox(width: 10),
                                      Text(
                                        feature,
                                        style: const TextStyle(
                                          color: Color(0xFF555555),
                                          fontSize: 15,
                                        ),
                                      ),
                                    ],
                                  ),
                                ))
                            .toList(),
                      ),
                      const SizedBox(height: 20),
                      ElevatedButton(
                        onPressed: () {},
                        style: ElevatedButton.styleFrom(
                          backgroundColor: const Color(0xFF1e5799),
                          padding: const EdgeInsets.symmetric(
                              horizontal: 20, vertical: 8),
                          shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(4),
                          ),
                        ),
                        child: const Text(
                          '了解详情',
                          style: TextStyle(
                            color: Colors.white,
                            fontSize: 14,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
                const SizedBox(width: 30),
                ImageNetwork(
                  platform['imageUrl'],
                  width: 250,
                  height: 180,
                  fit: BoxFit.cover,
                  // borderRadius: BorderRadius.circular(8),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

// 案例卡片组件
class CaseCard extends StatelessWidget {
  final Map<String, dynamic> caseItem;

  const CaseCard({super.key, required this.caseItem});

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(8),
        boxShadow: [
          BoxShadow(
            color: Colors.black12,
            blurRadius: 5,
            spreadRadius: 1,
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          ImageNetwork(
            caseItem['imageUrl'],
            width: double.infinity,
            height: 200,
            fit: BoxFit.cover,
          ),
          Container(
            padding: const EdgeInsets.all(20),
            color: Colors.white,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  caseItem['title'],
                  style: const TextStyle(
                    fontSize: 18,
                    color: Color(0xFF1e5799),
                    fontWeight: FontWeight.bold,
                    // margin: EdgeInsets.only(bottom: 10),
                  ),
                ),
                Text(
                  caseItem['description'],
                  style: const TextStyle(
                    color: Color(0xFF666666),
                    fontSize: 14,
                    // margin: EdgeInsets.only(bottom: 15),
                  ),
                ),
                InkWell(
                  onTap: () {},
                  child: const Text(
                    '查看详情 →',
                    style: TextStyle(
                      color: Color(0xFF207cca),
                      fontWeight: FontWeight.bold,
                      fontSize: 14,
                    ),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

// 章节标题组件
class SectionTitle extends StatelessWidget {
  final String title;

  const SectionTitle({super.key, required this.title});

  @override
  Widget build(BuildContext context) {
    return Container(
      padding: const EdgeInsets.only(bottom: 15),
      margin: const EdgeInsets.only(bottom: 30),
      decoration: const BoxDecoration(
        border: Border(
          bottom: BorderSide(
            color: Color(0xFFf0f0f0),
            width: 2,
          ),
        ),
      ),
      child: Stack(
        children: [
          Text(
            title,
            style: const TextStyle(
              fontSize: 24,
              color: Color(0xFF1e5799),
              fontWeight: FontWeight.bold,
            ),
          ),
          Positioned(
            bottom: -2,
            left: 0,
            child: Container(
              width: 80,
              height: 2,
              color: const Color(0xFF207cca),
            ),
          ),
        ],
      ),
    );
  }
}
